package com.tanhua.management.contoller;

import cn.hutool.core.util.ObjectUtil;
import com.tanhua.management.service.VideoManageService;
import com.tanhua.server.vo.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Create By Administrator on 2021/7/13.
 */
@RequestMapping("manage")
@RestController
//
public class VideoManageController {

    @Autowired
    private VideoManageService videoManageService;

    @GetMapping("/videos")
    public ResponseEntity getVideoManageList(Integer page, Integer pageSize){

        try {
            PageResult pageResult = this.videoManageService.queryVideoManList(page, pageSize);
            if (ObjectUtil.isNotEmpty(pageResult)) {
                return ResponseEntity.ok(pageResult);
            }
        } catch (Exception e) {
            //log.error(" 查询出错 ",e);
        }
        return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).build();
    }

}
